/*
Author: William Tumler
Class Name: PoliceStation
Functionality: This class for the Police Station building, and provides functionality for 
adding to current force, upgrading the building, and army assistance
last done: updated functions, changed some functionality
Version number: 0.0.6
Testers: needs to be tested
Date written: November 08, 2011
Date tested: needs to be tested
To-do:
*/
package disease;

public class PoliceStation extends Facilities{
private int forceSize;
private int forceMax;
private int Strength;
private boolean armyAssist;
private static int increaseSecurityCost = 1;//<--might want to change this
private static int armyCost = 100000;
private static boolean maxLevel = false;
	//all numbers subject to change whenever we decide what to use
	public PoliceStation(String type) {
		super(type);
		forceSize = 200; //"squads" (or officers?) initially available or something
		forceMax = 500; //initial max force
		Strength = 1;
		increaseSecurityCost = 1;
		armyAssist = false;
	}
	
	public boolean upgradePolice(){
		if (forceMax < 2000 && Strength < 10 && on == true){ //can increase/decrease max forces, temp numbers
			System.out.println("PoliceStation upgrade == true | forceMax & strength");
			forceMax += 500;
			Strength += 2;
			super.upgradeBuilding();
			return true;
		}
		else if (forceMax < 2000 && Strength >= 10 && on == true){ 
			System.out.println("PoliceStation upgrade == true | forcemax");
			forceMax += 500;
			super.upgradeBuilding();
			return true;
		}
		else if (forceMax >= 2000 && Strength < 10 && on == true){
			System.out.println("PoliceStation upgrade == true | strength"); 
			Strength += 2;
			super.upgradeBuilding();
			return true;
		}
		else {
			System.out.println("Cannot upgrade the policeStation further");
			maxLevel = true;
			return false;
			
		}
	}
	public boolean increaseSecurity(){
		if (forceSize < forceMax){
			if (forceSize+100 > forceMax){
				increaseSecurityCost += 1;
				System.out.println("Increase Security == true");
				System.out.println("Max force = "+forceMax);
				System.out.println("Force size = "+forceSize);
				System.out.println("Strength = "+Strength);
				forceSize = forceMax;
				return true;
			}
			else{
				increaseSecurityCost += 1;
				forceSize += 100;
				System.out.println("Increase Security == true");
				System.out.println("Max force = "+forceMax);
				System.out.println("Force size = "+forceSize);
				System.out.println("Strength = "+Strength);
				return true;
			}
		}
		else{
			System.out.println("Increase Security == false; max force size");
			System.out.println("Max force = "+forceMax);
			System.out.println("Force size ="+forceSize);
			System.out.println("Strength = "+Strength);
			return false;
		}
	}
	
	
	public boolean requestAssistance(){ //possible (expensive) special ability of Police Station
		if (armyAssist == false){ //similar to hospital's antidote, but increases strength 50% more than max
			System.out.println("Army assistance == true");
			armyAssist = true; 
			Strength = 15;
			forceSize += 150; //army sends 150 soldiers
			return true;
		}
		else { 
			System.out.println("Army assistance == false; cannot send");
			return false;
		}
	}
	
	public void killCops(int number){
		if(forceSize - number > 0){
			forceSize -= number;
		}else{
			forceSize = 0;
		}
	}
	
	public int getForceSize(){
		return forceSize;
	}
	
	public int getForceMax(){
		return forceMax;
	}
	
	public int getStrength(){
		return Strength;
	}
	
	public boolean getAssist(){
		return armyAssist;
	}
	
	public int getArmyCost(){
		return armyCost;
	}
	
	public int getIncreaseSecurityCost(){
		return increaseSecurityCost;
	}
	
    public boolean canUpgrade(){
    	return !maxLevel;
    }
    public boolean getMaxLevel(){
    	return maxLevel;
    }
}
